using System;
using System.Windows.Media;
namespace MicroMsg.Manager
{
	public class CustomSmiley
	{
		public CustomSmileyType Type = CustomSmileyType.CustomAdd;
		public string ThumbSrc;
		public string ImageSrc;
		public string MD5;
		public static CustomSmiley AddAction = new CustomSmiley(CustomSmileyType.AddAction, "Resource/Img/CustomSmiley/addAction_nor.png", "", "");
		public static CustomSmiley DeleteAction = new CustomSmiley(CustomSmileyType.DeleteAction, "Resource/Img/CustomSmiley/deleteAction.png", "", "");
		public static CustomSmiley Jsb = new CustomSmiley(CustomSmileyType.Jsb, "Resource/Img/CustomSmiley/jsb.png", "", "");
		public static CustomSmiley Dice = new CustomSmiley(CustomSmileyType.Dice, "Resource/Img/CustomSmiley/dice.png", "", "");
		public CustomSmiley()
		{
		}
		public CustomSmiley(CustomSmileyType Type)
		{
			this.Type = Type;
		}
		public CustomSmiley(CustomSmileyType Type, string ThumbSrc, string ImageSrc, string MD5)
		{
			this.Type = Type;
			this.ThumbSrc = ThumbSrc;
			this.ImageSrc = ImageSrc;
			this.MD5 = MD5;
		}
		public ImageSource getThumbImage()
		{
			if (this.ThumbSrc == null || this.ThumbSrc.get_Length() == 0)
			{
				return null;
			}
			if (this.Type == CustomSmileyType.CustomAdd)
			{
				return ImageCacheMgr.loadFromFile(this.ThumbSrc);
			}
			return ImageCacheMgr.loadFromRes(this.ThumbSrc);
		}
	}
}
